package com.yshkj.payment.entity;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 账号角色表
 * 用于关联账号和角色的中间表
 * Created by 唐旭 on 2016/9/7.
 */
@Entity
@Table
public class UserAccountRole extends BaseDomain {

    //关联账号
    @ManyToOne
    @JoinColumn(name = "user_account")
    private UserAccount userAccount;

    //关联角色
    @ManyToOne
    @JoinColumn(name = "user_role")
    private UserRole userRole;

    public UserAccountRole() {
    }

    public UserAccountRole(UserAccount userAccount) {
        this.userAccount = userAccount;
    }

    public UserAccountRole(UserRole userRole) {
        this.userRole = userRole;
    }

    public UserAccountRole(UserAccount userAccount, UserRole userRole) {
        this.userAccount = userAccount;
        this.userRole = userRole;
    }

    public UserAccount getUserAccount() {
        return userAccount;
    }

    public UserAccountRole setUserAccount(UserAccount userAccount) {
        this.userAccount = userAccount;
        return this;
    }

    public UserRole getUserRole() {
        return userRole;
    }

    public UserAccountRole setUserRole(UserRole userRole) {
        this.userRole = userRole;
        return this;
    }
}
